package test;

import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class test {
    @Test
    public void test() throws IOException {
        XSSFWorkbook workbook = new XSSFWorkbook();
        XSSFSheet sheet = workbook.createSheet("sheet1");

        for (int i = 0; i < 5; i++) {
            XSSFRow row = sheet.createRow(i);
           row.createCell(0).setCellValue("日期");
           row.createCell(1).setCellValue("人数");
        }

        FileOutputStream out = new FileOutputStream("E:\\Java\\Test\\image\\health\\report.xlsx");
        workbook.write(out);

        out.flush();
        out.close();
        workbook.close();

    }
}
